/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1583414226235_4704';

  // add your middleware config here
  config.middleware = [
    'test', // 中间件test
  ];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    security: {
      csrf: {
        enable: false,
      },
    },
    // add prod log config 线上环境不建议开启
    /*logger: {
      level: 'DEBUG',
      allowDebugAtProd: true,
      consoleLevel: 'DEBUG',
      disableConsoleAfterReady: false, // 线上环境打开log日志
      dir: './logs/prod'
    }*/
  };


  return {
    ...config,
    ...userConfig,
  };
};
